package nexus.com.container
{
	import nexus.base.NXSprite;
	
	/**
	 * <br>설명 : </br> 
	 * @author winnie
	 */	
	public class WrapperContainer extends NXSprite
	{
		//-----------------------------------------------------------------------------------
		//
		// private vars
		//
		//-----------------------------------------------------------------------------------
		
		//-----------------------------------------------------------------------------------
		//
		// protected vars
		//
		//-----------------------------------------------------------------------------------
		
		
		//-----------------------------------------------------------------------------------
		//
		// public vars
		//
		//-----------------------------------------------------------------------------------
		
		
		
		//-----------------------------------------------------------------------------------
		//
		// constructor
		//
		//-----------------------------------------------------------------------------------
		public function WrapperContainer()
		{
			super();
		}
		
		
		//-----------------------------------------------------------------------------------
		//
		// setter / getter
		//
		//-----------------------------------------------------------------------------------
		
		
		//-----------------------------------------------------------------------------------
		//
		// public function
		//
		//-----------------------------------------------------------------------------------
		
		
		public function setBg():void
		{
			this.viewWidth = this.width;
			this.viewHeight = measuredHeight;
			this.backGroundAlpha = 0;
			this.backGroundColor = 0x000000;
			
			trace(" ==> WrapperContainer setBg : " + this.viewWidth, this.viewHeight );
			
			this.updateDefaultDisplayList();
		}
		
		
		override public function get height():Number
		{
			return (viewHeight==0) ? measuredHeight : viewHeight;
		}
		
		/**
		 * @return  
		 */		
		public function get measuredHeight():Number
		{
			
			if( this.numChildren == 0 ) return 0;

			var minNum : Number = this.getChildAt(0).y;
			var maxNum : Number = this.getChildAt(0).y+this.getChildAt(0).height;
			var len:int = this.numChildren;
			for (var i:int = 1; i < len; i++) 
			{
				minNum = Math.min( this.getChildAt(i).y , minNum ); 
				maxNum = Math.max( this.getChildAt(i).y+this.getChildAt(i).height , maxNum ); 
			}
			
			
			return maxNum-minNum;
		}
		
		
		//-----------------------------------------------------------------------------------
		//
		// protected function
		//
		//-----------------------------------------------------------------------------------
		
		
		
		
		//-----------------------------------------------------------------------------------
		//
		// private function
		//
		//-----------------------------------------------------------------------------------
		
		
		
		//-----------------------------------------------------------------------------------
		//
		// event handler
		//
		//-----------------------------------------------------------------------------------
		
		
		
		//-----------------------------------------------------------------------------------
		//
		// destory
		//
		//-----------------------------------------------------------------------------------


	}
}